﻿<Window x:Class="MathematicallySafe.HeadCounter.Dialogs.NewRaiderQueryDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Confirm New Raider" WindowStartupLocation="CenterScreen" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
    <Grid Margin="8">

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="24"/>
            <ColumnDefinition Width="350"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- todo tidy up this dialog, factor out styles, etc.-->
        
        <TextBlock Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4" FontWeight="Bold">Name:</TextBlock>
        <TextBlock Grid.Column="1" Text="{Binding Path=Name}" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4"/>
        <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4" FontWeight="Bold">Race:</TextBlock>
        <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=Race, Converter={StaticResource EnumDescriptionConverter}}" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4" />
        <TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4" FontWeight="Bold">Class:</TextBlock>
        <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Path=Class, Converter={StaticResource EnumDescriptionConverter}}" Grid.ColumnSpan="2" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="4" />

        <RadioButton Name="radioNewRaider" Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" 
                     Margin="4" IsChecked="{Binding Path=IsNew}">Yes, this is a new raider.</RadioButton>

        <RadioButton Name="radioAlt" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2"
                     Margin="4" IsChecked="{Binding Path=IsAlt}">No, this is an alt, link their details to an existing raider.</RadioButton>
        
        <ComboBox Name="comboAltName" Grid.Row="5" Grid.Column="2" Margin="0,4"
                  IsEnabled="{Binding Path=IsAlt}"
                  SelectedValue="{Binding Path=AltName}" ItemsSource="{Binding PossibleAltNames}" />
        
        <CheckBox Name="checkBoxReroll" Grid.Row="6" Grid.Column="2" Margin="0,4" HorizontalAlignment="Left"
                  IsChecked="{Binding Path=IsNewMain}"
                  IsEnabled="{Binding Path=IsAlt}">Make this character this raider's new Main.</CheckBox>

        <StackPanel Grid.Row="7" Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Name="OkButton" Margin="4" IsDefault="True" Command="{Binding Path=OkCommand}" Click="OkButton_Click">Add Raider</Button>
            <Button Name="CancelButton" Margin="4" IsCancel="True" Command="{Binding Path=CancelCommand}" Click="CancelButton_Click">Ignore Raider</Button>
        </StackPanel>

    </Grid>
</Window>
